import http from './request'

//获取全部场次 /flashSession/list
const  flashSessionList =():PRES<Iseckill[]>=>http.get(`/flashSession/list`)


//添加场次 /flashSession/create
const IflashCreate = (params:Iseckill):PRES<Iseckill>=>http.post(`/flashSession/create`,params)


//修改场次 /flashSession/update/{id}
const flashSessionUpdate = (params:Iseckill):PRES<Iseckill>=>http.post(`/flashSession/update/${params.id}`,params)

//获取场次详情 /flashSession/{id}
const flashSessionId = (id:number): PRES<Iseckill> => http.get(`/flashSession/${id}`);

//删除场次 /flashSession/delete/{id}
const IdeleteId = (idn:number[]):PRES<Iseckill>=>http.post(`/flashSession/delete/${idn}`)

// /flashSession/selectList  获取全部可选场次及其数量
const IselectList = (id:number): PRES<Iproducts[]> =>http.get(`/flashSession/selectList?flashPromotionId=${id}`)

export{
    flashSessionList,
    IflashCreate,
    flashSessionUpdate,
    flashSessionId,
    IdeleteId,
    IselectList
}